#触发

from selenium import webdriver
import time,os,sys,pytest
sys.path.append(os.getcwd())

from utils.readConfigUtils import readConfig
from service.serviceForm import ServiceForm
from utils.initDriver import init_driver
from utils.readYamlUtils import readCesiData

class TestLigin(object):
    def setup_class(self):
        self.base_url=readConfig("config/webDomainConfig.yaml")["base_url"] #"https://shop.aircheng.com"

    def teardown_class(self):
        pass

    def setup(self):
        #定义driver
        self.driver =init_driver()

        #定义业务对象
        self.service_form=ServiceForm(self.driver,self.base_url)


    def teardown(self):
        time.sleep(5)
        self.driver.quit()


    @pytest.mark.parametrize("d",readCesiData("data/form.yaml","test_form_001"))
    def test_form_001(self,d):
        assert self.service_form.service_form_001(d)

